﻿namespace Home
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Web;

    public static class CommonHelper
    {
        public static bool AreEqual<T>(this IEnumerable<T> left, IEnumerable<T> right)
        {
            Debug.Assert(left != null);
            Debug.Assert(right != null);

            if (left.Count() != right.Count())
            {
                return false;
            }

            for (int i = 0; i < left.Count(); i++)
            {
                if (!object.Equals(left.ElementAt(i), right.ElementAt(i)))
                {
                    return false;
                }
            }

            return true;
        }
    }
}